package com.dime.physical.controller;

import com.dime.physical.domain.DimePhysicalregister;
import com.dime.physical.domain.dto.PersonReportDto;
import com.dime.physical.domain.dto.PhysicalabnormalOrderDto;
import com.dime.physical.domain.dto.SearchPhysicalregister;
import com.dime.physical.service.IDimeReportService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/Report")
public class DimeReportController extends BaseController {

    @Autowired
    private IDimeReportService dimeReportService;




    //@RequiresPermissions("physical:Report:list")
    @PostMapping("/list")
    public AjaxResult list(@RequestBody SearchPhysicalregister searchPhysicalregister)
    {

        List<DimePhysicalregister> list = dimeReportService.getPrintReportByTypeList(searchPhysicalregister);
        return success(list);
    }




    //@RequiresPermissions("physical:Report:getPhysicalPersonReport")
    @PostMapping("/getPhysicalPersonReport")
    public AjaxResult getPhysicalPersonReport(@RequestBody DimePhysicalregister dimePhysicalregister) {

        PersonReportDto personReportDto = dimeReportService.getPhysicalReport(dimePhysicalregister);

        return success(personReportDto);
    }





  //  @RequiresPermissions("physical:Report:getAbnormalOderData")
    @PostMapping("/getAbnormalOderData")
    public AjaxResult getAbnormalOderData(@RequestBody SearchPhysicalregister searchPhysicalregister)
    {
        PhysicalabnormalOrderDto physicalabnormalOrderDto =dimeReportService.getPhysicalOccDiseaseOrContraindications(searchPhysicalregister);
        return success(physicalabnormalOrderDto);
    }
//
//    @RequiresPermissions("physical:Report:getPhysicalContraindications")
//    @PostMapping("/getPhysicalContraindications")
//    public AjaxResult getPhysicalContraindications(@RequestBody SearchPhysicalregister searchPhysicalregister)
//    {
//        PhysicalabnormalOrderDto physicalabnormalOrderDto=dimeReportService.getPhysicalOccDiseaseOrContraindications(searchPhysicalregister);
//        return success(physicalabnormalOrderDto);
//    }
//
//
//
//    @RequiresPermissions("physical:Report:getPhysicalRecheckCombs")
//    @PostMapping("/getPhysicalRecheckCombs")
//    public AjaxResult getPhysicalRecheckCombs(@RequestBody SearchPhysicalregister searchPhysicalregister)
//    {
//        PhysicalabnormalOrderDto physicalabnormalOrderDto=dimeReportService.getPhysicalOccDiseaseOrContraindications(searchPhysicalregister);
//        return success(physicalabnormalOrderDto);
//    }

}
